package com.econ.powercloud.ems.common.enums;

/**
 * @Author : zjf
 * @Description :
 * @Date : 2021/9/23 14:26
 * @Modified by : zjf
 */
public enum MeterTagType implements EnumMethod{

    //小时
    HOUR(1, "每小时","HOUR"),
    //天
    DAY(2, "天","DAY"),
    //月
    MONTH(3,"月","MONTH"),
    ;

    private Integer code;
    private String desc;
    //标识
    private String tag;

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getDesc() {
        return desc;
    }

    public String getTag() {
        return tag;
    }

    MeterTagType(int code, String desc, String tag){
        this.code=code;
        this.desc=desc;
        this.tag=tag;
    }

    public static String getCodeFromCode(int code){
        for(MeterTagType type: MeterTagType.values()){
            if(type.getCode() == code){
                return type.getDesc();
            }
        }
        return null;
    }

}
